<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}
<style>
    .about-content{
	    white-space:nowrap;overflow:hidden;text-overflow: ellipsis;
    }
</style>
    <div class="subnav">
        <a href="">首页</a> &gt; <a href="">系统管理</a> &gt; <a href="">关于我们</a>
    </div>
    <div class="main-inner">
        <div class="x-body">
            <div class="tablefilter">
                <div class="tablebutton" style="margin-bottom:40px;">
                    <a href="?m=system&c=about_add" class=""><i class="fa fa-plus"></i>新增</a>
                    <a href="javascript:void(0);" onclick="choose_all();"><i class="fa fa-check"></i>全选</a>
                    <a href="javascript:void(0);" onclick="del();"><i class="fa fa-trash"></i>删除</a>      
            	</div>
                <table class="layui-table">
                    <thead>
                        <tr>
                            <th>选择</th>
                            <th>标题</th>
                            <th>内容简略</th>
                            <th>发布时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody id="datalist">
                    	{loop $data as $key=>$val}
                        <tr id="tr_$val['id']">
                            <td>
                                <input type="checkbox" name="ids[$key]" class="del" value="{$val['id']}" />
                            </td>
                            <td>{$val['title']}</td>
                            <td class="about-content">{CutStr(strip_tags($val['content']),60)}</td>
                            <td>{date('Y-m-d',$val['dateline'])}</td>
                            <td><a href="?m=system&c=about_add&id={$val['id']}">编辑</a></td>                          
                        </tr>
                        {/loop}
                    </tbody>
                </table>
                <div class="layui-clear">
                    <div id="pages" class="layui-laypage">{$multi}</div>
                </div>
             </div>
        </div>
    </div>
    <script type="text/javascript">
        function choose_all(){
    		$(".del").each(function(n,j){
    			if(!$(this).is(":checked")){
    				$(this).prop("checked",true);	
    			}else{
    				$(this).removeAttr("checked",false);
    			}
    		})
        }
    	   
    	function del(){
    		var arr = [];
    		$(".del").each(function(n,j){
				if($(this).is(":checked")){
					arr.push($(this).val());
				}
			});
    		$.post('?m=system&c=about&a=del',{
				'del_ids': arr
			},function (json){
				if(json.status=="1"){
					alert("删除成功！");
					location.href=location.href;
				}else{
					alert("失败");
				}
			},'json');


			
        }	
    </script>
        
        
        
{template index/footer}
